Skip to content

fix: restore ComponentMap and ColorComponentMap in prelude for v0.8 compat#156

Open
lilith wants to merge 1 commit intokornelski:mainfrom
lilith:prelude-backcompat
Open

fix: restore ComponentMap and ColorComponentMap in prelude for v0.8 compat#156
lilith wants to merge 1 commit intokornelski:mainfrom
lilith:prelude-backcompat

Conversation

@lilith
Copy link
Contributor

@lilith lilith commented Mar 4, 2026

Summary

  • Re-adds ComponentMap and ColorComponentMap to rgb::prelude alongside the new trait exports (Pixel, HetPixel, etc.)
  • Without this, code using use rgb::prelude::* with ComponentMap::map(...) or .map_c(...) breaks on upgrade from 0.8.41 — a semver violation for a patch release
  • ComponentMap is just Pixel under a different name; ColorComponentMap::map_c has no method name conflicts with any new prelude trait
  • Adds CHANGELOG.md documenting formatting fixes and trait changes since v0.8.41

Test plan

  • cargo test --all --all-features passes
  • No new trait method ambiguity: ComponentMap = Pixel (same trait), ColorComponentMap::map_c is unique

The v0.8 prelude exported ComponentMap and ColorComponentMap. The new
prelude dropped them in favor of Pixel, HetPixel, etc. This breaks
patch compatibility for code using `use rgb::prelude::*` with
trait-qualified calls like `ComponentMap::map(...)` or method calls
like `.map_c(...)`.

Add both back alongside the new exports. ComponentMap is just a
re-export of Pixel (same trait), and ColorComponentMap::map_c has no
method name conflicts with any new prelude trait.

Also adds CHANGELOG.md documenting formatting fixes, trait changes,
and Gray v08→v09 migration guide.
@lilith lilith force-pushed the prelude-backcompat branch from 9f4b1ef to 9872650 Compare March 4, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant